package org.example.ioc_demo.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class BeanConfig {
    @Bean
    public String name2(){
        return "kzf";
    }

    @Bean
    public String name(){
        return "lyy";
    }

    @Bean
    public UserInfo userInfo(String name){
        UserInfo userInfo = new UserInfo();
        userInfo.setAge(18);
        userInfo.setName(name);
        userInfo.setAddress("111");
        return userInfo;
    }
    @Bean
    public UserInfo userInfo2(){
        UserInfo userInfo = new UserInfo();
        userInfo.setAge(19);
        userInfo.setName("whx");
        userInfo.setAddress("222");
        return userInfo;
    }
}
